package org.hyh.transactional;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.beans.Introspector;

/**
 * @auther :hyh
 * @desc :
 * @date :2019/12/17
 */
public class TestTx {

	public static void main(String[] args) {
		ApplicationContext ac = new AnnotationConfigApplicationContext(TransactionalConfig.class);

		System.out.println(AccountImpl.class.getSimpleName());
		//-------------------byName------------------
		Object bean = ac.getBean(Introspector.decapitalize(AccountImpl.class.getSimpleName()));
		System.out.println(bean);
		Object bean1 = ac.getBean(Introspector.decapitalize(IAccountImpl.class.getSimpleName()));
		System.out.println(bean1);
        //------------------byType----------------------
		System.out.println("------------------------------------");
		IAccountImpl bean_01 = ac.getBean(IAccountImpl.class);
		System.out.println(bean_01);
		IAcount bean_02 = ac.getBean(IAcount.class);
		System.out.println(bean_02);

	}
}
